﻿
 
// Author     : Leo King
// CreateDate : 2014/6/3 10:43:56
// CopyRight  : CopyRight @lktec 2013~2015
// Site       : http://www.lktec.cn
// Version    : 1.0.0.1

using System.Data.Entity;
using System.Data.Entity.Infrastructure;

namespace yc.Dal
{
	public partial class DBContext : DbContext
	{
		#region 初始化
		/// <summary>
		/// 初始化
		/// </summary>
		/// <param name="lazy">延迟加载</param>
		public DBContext(bool lazy = true) : base("Default")
		{
			this.Configuration.AutoDetectChangesEnabled = false;
			this.Configuration.ProxyCreationEnabled = lazy;
			this.Configuration.LazyLoadingEnabled = lazy;
		}
		#endregion

		#region 对象映射
		protected override void OnModelCreating(DbModelBuilder modelBuilder)
		{
			#region Table Mapping
			modelBuilder.Entity<SysArea>().ToTable("SysArea");
			modelBuilder.Entity<SysClient>().ToTable("SysClient");
			modelBuilder.Entity<SysCompany>().ToTable("SysCompany");
			modelBuilder.Entity<SysCompanyEmployee>().ToTable("SysCompanyEmployee");
			modelBuilder.Entity<SysIntroduce>().ToTable("SysIntroduce");
			modelBuilder.Entity<SysUser>().ToTable("SysUser");
			modelBuilder.Entity<SysClientTraining>().ToTable("SysClientTraining");
			modelBuilder.Entity<SysClientWorking>().ToTable("SysClientWorking");
			modelBuilder.Entity<SysDictionary>().ToTable("SysDictionary");
			modelBuilder.Entity<SysCompanyContact>().ToTable("SysCompanyContact");
			modelBuilder.Entity<SysClientBlockHistory>().ToTable("SysClientBlockHistory");
			#endregion
			base.OnModelCreating(modelBuilder);
		}
		#endregion

		#region 对象属性
		/// <summary>
		/// 系统区域
		/// </summary>
		public DbSet<SysArea> SysArea { get; set; }

		/// <summary>
		/// 系统会员
		/// </summary>
		public DbSet<SysClient> SysClient { get; set; }

		/// <summary>
		/// 公司信息
		/// </summary>
		public DbSet<SysCompany> SysCompany { get; set; }

		/// <summary>
		/// 公司招聘
		/// </summary>
		public DbSet<SysCompanyEmployee> SysCompanyEmployee { get; set; }

		/// <summary>
		/// 系统介绍信
		/// </summary>
		public DbSet<SysIntroduce> SysIntroduce { get; set; }

		/// <summary>
		/// 系统用户
		/// </summary>
		public DbSet<SysUser> SysUser { get; set; }

		/// <summary>
		/// 培训经历
		/// </summary>
		public DbSet<SysClientTraining> SysClientTraining { get; set; }

		/// <summary>
		/// 工作经历
		/// </summary>
		public DbSet<SysClientWorking> SysClientWorking { get; set; }

		/// <summary>
		/// 数据字典
		/// </summary>
		public DbSet<SysDictionary> SysDictionary { get; set; }

		/// <summary>
		/// 公司联系人
		/// </summary>
		public DbSet<SysCompanyContact> SysCompanyContact { get; set; }

		/// <summary>
		/// 系统会员黑名单记录
		/// </summary>
		public DbSet<SysClientBlockHistory> SysClientBlockHistory { get; set; }

		#endregion
	}
}
